package com.wt.admin.mapper.language;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wt.admin.domain.dto.language.KeywordsDTO;
import com.wt.admin.domain.entity.language.ClassificationEntity;
import com.wt.admin.domain.entity.language.KeywordsEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface KeywordsMapper extends BaseMapper<KeywordsEntity> {

    void insertBatch(@Param("list") List<KeywordsDTO> keywords);

    void insertOrUpdateBatch(@Param("list") List<KeywordsDTO> keywords);

    @Delete("delete from language_keywords where classification_id = #{id} ")
    void deleteByClassId(@Param("id") Integer id);

    void deleteByClassIdAndNotInKeyId(@Param("id") Integer id,@Param("list")  List<KeywordsDTO> keywords);
}
